<template>
	<view class="container">
		<web-view :src="externalUrl"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				externalUrl: ''
			};
		},
		onLoad(options) {
			var reg=/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
			console.log(options.url)
			if(!reg.test(options.url)) {
				this.externalUrl = 'https://' + options.url
			}else {
				this.externalUrl = options.url;
			}
			
			
		}
	};
</script>

<style scoped>
	.container {
		width: 100%;
		height: 100vh;
	}
</style>